package com.crx.springbootinit.controller.admin;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.crx.springbootinit.annotation.AuthCheck;
import com.crx.springbootinit.annotation.LogApiAnno;
import com.crx.springbootinit.common.BaseResponse;
import com.crx.springbootinit.common.ResultUtils;
import com.crx.springbootinit.model.dto.comment.CommentsPageDTO;
import com.crx.springbootinit.model.dto.follow.FollowPageDTO;
import com.crx.springbootinit.model.dto.page.PageVO;
import com.crx.springbootinit.model.entity.Comment;
import com.crx.springbootinit.model.vo.comment.CommentPageVO;
import com.crx.springbootinit.model.vo.follow.FollowPageVo;
import com.crx.springbootinit.service.ICommentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/comment")
@Api(tags = "后台评论模块接口")
public class CommentAdminController {
    @Autowired
    private ICommentService commentService;

    @GetMapping("/page")
    @ResponseBody
    @ApiOperation("分页查询评论列表")
    @LogApiAnno(title = "分页查询模块", businessType = "GET")
    @AuthCheck
    public BaseResponse page(CommentsPageDTO commentsPageDTO){
        PageVO<CommentPageVO> pageVO = commentService.queryCommentPage(commentsPageDTO);
        return BaseResponse.success(pageVO);
    }
}
